<%@page import="org.esisar.dao.PictureStatementCreator"%>
<%@page import="org.esisar.dao.JDBCDAO"%>
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
<%@ page import="java.util.List" %>
<%@ page import="org.esisar.model.*" %>
<%@include file="/GoHome.jsp"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Insert title here</title>
</head>
<body>

	<h1 align="center"><font size="10"><b>${album.title}</b></font></h1>
	</br>
	
	<h2 align="center"><font size="5">${album.subTitle}</font></h2>
	
	<% String photoString = request.getAttribute("photoNumber").toString();
		int photoNumber = Integer.parseInt(photoString);
		
	   List<PictureOfAlbum> picturesofAlbum = (List<PictureOfAlbum>)(List<?>)request.getAttribute("pictures");
	
	   for (int i =0 ; i < picturesofAlbum.size(); i++){
	   
	   	PictureOfAlbum pictureOfAlbum = picturesofAlbum.get(i);
		   
		   JDBCDAO jdbcdao = new JDBCDAO();
		   
		    Picture picture = (Picture)jdbcdao.find(new PictureStatementCreator(),"idPicture" , pictureOfAlbum.getIdPicture()+"");
		   
		
		    
		   out.print(pictureOfAlbum.getTitle()+"</br>");
		
		   out.print("<form action=\"/Cs420Web/PhotoDisplay\" method=\"get\">");

		   out.print("<input type=\"hidden\" name=\"image\" value=" + picture.getIdPicture() + " ></td>");

		   
		   out.println("<input type=\"image\" name=\"photo\" value="+picture.getUrl() +" src="+ picture.getUrl() +" width=\"300\" height=\"300\"></br>");

		   out.print("</form>");
		   
		   out.print(pictureOfAlbum.getComments()+"</br>");
		   
		   
	   }     
	%>
	
	
	
</body>
</html>